3.81 \(\int \frac{(d+e x) (a+b \log (c x^n))^2}{x^3} \, dx\)

Optimal. Leaf size=103 \[ -\frac{b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac{2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac{b^2 d n^2}{4 x^2}-\frac{2 b^2 e n^2}{x} \]

[Out]

-(b^2*d*n^2)/(4*x^2) - (2*b^2*e*n^2)/x - (b*d*n*(a + b*Log[c*x^n]))/(2*x^2) - (2*b*e*n*(a + b*Log[c*x^n]))/x -
 (d*(a + b*Log[c*x^n])^2)/(2*x^2) - (e*(a + b*Log[c*x^n])^2)/x

________________________________________________________________________________________

Rubi [A]  time = 0.133665, antiderivative size = 103, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {2353, 2305, 2304} \[ -\frac{b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac{2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac{b^2 d n^2}{4 x^2}-\frac{2 b^2 e n^2}{x} \]

Antiderivative was successfully verified.

[In]

Int[((d + e*x)*(a + b*Log[c*x^n])^2)/x^3,x]

[Out]

-(b^2*d*n^2)/(4*x^2) - (2*b^2*e*n^2)/x - (b*d*n*(a + b*Log[c*x^n]))/(2*x^2) - (2*b*e*n*(a + b*Log[c*x^n]))/x -
 (d*(a + b*Log[c*x^n])^2)/(2*x^2) - (e*(a + b*Log[c*x^n])^2)/x

Rule 2353

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 2305

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Lo
g[c*x^n])^p)/(d*(m + 1)), x] - Dist[(b*n*p)/(m + 1), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2304

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[((d*x)^(m + 1)*(a + b*Log[c*x^
n]))/(d*(m + 1)), x] - Simp[(b*n*(d*x)^(m + 1))/(d*(m + 1)^2), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rubi steps

\begin{align*} \int \frac{(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^3} \, dx &=\int \left (\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{x^3}+\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x^2}\right ) \, dx\\ &=d \int \frac{\left (a+b \log \left (c x^n\right )\right )^2}{x^3} \, dx+e \int \frac{\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx\\ &=-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x}+(b d n) \int \frac{a+b \log \left (c x^n\right )}{x^3} \, dx+(2 b e n) \int \frac{a+b \log \left (c x^n\right )}{x^2} \, dx\\ &=-\frac{b^2 d n^2}{4 x^2}-\frac{2 b^2 e n^2}{x}-\frac{b d n \left (a+b \log \left (c x^n\right )\right )}{2 x^2}-\frac{2 b e n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac{d \left (a+b \log \left (c x^n\right )\right )^2}{2 x^2}-\frac{e \left (a+b \log \left (c x^n\right )\right )^2}{x}\\ \end{align*}

Mathematica [A]  time = 0.0479543, size = 90, normalized size = 0.87 \[ -\frac{2 a^2 (d+2 e x)+2 b \log \left (c x^n\right ) (2 a (d+2 e x)+b n (d+4 e x))+2 a b n (d+4 e x)+2 b^2 (d+2 e x) \log ^2\left (c x^n\right )+b^2 n^2 (d+8 e x)}{4 x^2} \]

Antiderivative was successfully verified.

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n])^2)/x^3,x]

[Out]

-(2*a^2*(d + 2*e*x) + 2*a*b*n*(d + 4*e*x) + b^2*n^2*(d + 8*e*x) + 2*b*(2*a*(d + 2*e*x) + b*n*(d + 4*e*x))*Log[
c*x^n] + 2*b^2*(d + 2*e*x)*Log[c*x^n]^2)/(4*x^2)

________________________________________________________________________________________

Maple [C]  time = 0.198, size = 1483, normalized size = 14.4 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2/x^3,x)

[Out]

-1/2*b^2*(2*e*x+d)/x^2*ln(x^n)^2-1/2*(2*I*Pi*b^2*e*x*csgn(I*x^n)*csgn(I*c*x^n)^2-2*I*Pi*b^2*e*x*csgn(I*x^n)*cs
gn(I*c*x^n)*csgn(I*c)-2*I*Pi*b^2*e*x*csgn(I*c*x^n)^3+2*I*Pi*b^2*e*x*csgn(I*c*x^n)^2*csgn(I*c)+4*ln(c)*b^2*e*x+
4*b^2*e*n*x+4*a*b*e*x+I*Pi*b^2*d*csgn(I*x^n)*csgn(I*c*x^n)^2-I*Pi*b^2*d*csgn(I*x^n)*csgn(I*c*x^n)*csgn(I*c)-I*
Pi*b^2*d*csgn(I*c*x^n)^3+I*Pi*b^2*d*csgn(I*c*x^n)^2*csgn(I*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________________________________________________________________________________________

Maxima [A]  time = 1.06153, size = 203, normalized size = 1.97 \begin{align*} -2 \, b^{2} e{\left (\frac{n^{2}}{x} + \frac{n \log \left (c x^{n}\right )}{x}\right )} - \frac{1}{4} \, b^{2} d{\left (\frac{n^{2}}{x^{2}} + \frac{2 \, n \log \left (c x^{n}\right )}{x^{2}}\right )} - \frac{b^{2} e \log \left (c x^{n}\right )^{2}}{x} - \frac{2 \, a b e n}{x} - \frac{2 \, a b e \log \left (c x^{n}\right )}{x} - \frac{b^{2} d \log \left (c x^{n}\right )^{2}}{2 \, x^{2}} - \frac{a b d n}{2 \, x^{2}} - \frac{a^{2} e}{x} - \frac{a b d \log \left (c x^{n}\right )}{x^{2}} - \frac{a^{2} d}{2 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="maxima")

[Out]

-2*b^2*e*(n^2/x + n*log(c*x^n)/x) - 1/4*b^2*d*(n^2/x^2 + 2*n*log(c*x^n)/x^2) - b^2*e*log(c*x^n)^2/x - 2*a*b*e*
n/x - 2*a*b*e*log(c*x^n)/x - 1/2*b^2*d*log(c*x^n)^2/x^2 - 1/2*a*b*d*n/x^2 - a^2*e/x - a*b*d*log(c*x^n)/x^2 - 1
/2*a^2*d/x^2

________________________________________________________________________________________

Fricas [A]  time = 0.991838, size = 420, normalized size = 4.08 \begin{align*} -\frac{b^{2} d n^{2} + 2 \, a b d n + 2 \, a^{2} d + 2 \,{\left (2 \, b^{2} e x + b^{2} d\right )} \log \left (c\right )^{2} + 2 \,{\left (2 \, b^{2} e n^{2} x + b^{2} d n^{2}\right )} \log \left (x\right )^{2} + 4 \,{\left (2 \, b^{2} e n^{2} + 2 \, a b e n + a^{2} e\right )} x + 2 \,{\left (b^{2} d n + 2 \, a b d + 4 \,{\left (b^{2} e n + a b e\right )} x\right )} \log \left (c\right ) + 2 \,{\left (b^{2} d n^{2} + 2 \, a b d n + 4 \,{\left (b^{2} e n^{2} + a b e n\right )} x + 2 \,{\left (2 \, b^{2} e n x + b^{2} d n\right )} \log \left (c\right )\right )} \log \left (x\right )}{4 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="fricas")

[Out]

-1/4*(b^2*d*n^2 + 2*a*b*d*n + 2*a^2*d + 2*(2*b^2*e*x + b^2*d)*log(c)^2 + 2*(2*b^2*e*n^2*x + b^2*d*n^2)*log(x)^
2 + 4*(2*b^2*e*n^2 + 2*a*b*e*n + a^2*e)*x + 2*(b^2*d*n + 2*a*b*d + 4*(b^2*e*n + a*b*e)*x)*log(c) + 2*(b^2*d*n^
2 + 2*a*b*d*n + 4*(b^2*e*n^2 + a*b*e*n)*x + 2*(2*b^2*e*n*x + b^2*d*n)*log(c))*log(x))/x^2

________________________________________________________________________________________

Sympy [B]  time = 1.39852, size = 272, normalized size = 2.64 \begin{align*} - \frac{a^{2} d}{2 x^{2}} - \frac{a^{2} e}{x} - \frac{a b d n \log{\left (x \right )}}{x^{2}} - \frac{a b d n}{2 x^{2}} - \frac{a b d \log{\left (c \right )}}{x^{2}} - \frac{2 a b e n \log{\left (x \right )}}{x} - \frac{2 a b e n}{x} - \frac{2 a b e \log{\left (c \right )}}{x} - \frac{b^{2} d n^{2} \log{\left (x \right )}^{2}}{2 x^{2}} - \frac{b^{2} d n^{2} \log{\left (x \right )}}{2 x^{2}} - \frac{b^{2} d n^{2}}{4 x^{2}} - \frac{b^{2} d n \log{\left (c \right )} \log{\left (x \right )}}{x^{2}} - \frac{b^{2} d n \log{\left (c \right )}}{2 x^{2}} - \frac{b^{2} d \log{\left (c \right )}^{2}}{2 x^{2}} - \frac{b^{2} e n^{2} \log{\left (x \right )}^{2}}{x} - \frac{2 b^{2} e n^{2} \log{\left (x \right )}}{x} - \frac{2 b^{2} e n^{2}}{x} - \frac{2 b^{2} e n \log{\left (c \right )} \log{\left (x \right )}}{x} - \frac{2 b^{2} e n \log{\left (c \right )}}{x} - \frac{b^{2} e \log{\left (c \right )}^{2}}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2/x**3,x)

[Out]

-a**2*d/(2*x**2) - a**2*e/x - a*b*d*n*log(x)/x**2 - a*b*d*n/(2*x**2) - a*b*d*log(c)/x**2 - 2*a*b*e*n*log(x)/x
- 2*a*b*e*n/x - 2*a*b*e*log(c)/x - b**2*d*n**2*log(x)**2/(2*x**2) - b**2*d*n**2*log(x)/(2*x**2) - b**2*d*n**2/
(4*x**2) - b**2*d*n*log(c)*log(x)/x**2 - b**2*d*n*log(c)/(2*x**2) - b**2*d*log(c)**2/(2*x**2) - b**2*e*n**2*lo
g(x)**2/x - 2*b**2*e*n**2*log(x)/x - 2*b**2*e*n**2/x - 2*b**2*e*n*log(c)*log(x)/x - 2*b**2*e*n*log(c)/x - b**2
*e*log(c)**2/x

________________________________________________________________________________________

Giac [B]  time = 1.34219, size = 277, normalized size = 2.69 \begin{align*} -\frac{4 \, b^{2} n^{2} x e \log \left (x\right )^{2} + 8 \, b^{2} n^{2} x e \log \left (x\right ) + 8 \, b^{2} n x e \log \left (c\right ) \log \left (x\right ) + 2 \, b^{2} d n^{2} \log \left (x\right )^{2} + 8 \, b^{2} n^{2} x e + 8 \, b^{2} n x e \log \left (c\right ) + 4 \, b^{2} x e \log \left (c\right )^{2} + 2 \, b^{2} d n^{2} \log \left (x\right ) + 8 \, a b n x e \log \left (x\right ) + 4 \, b^{2} d n \log \left (c\right ) \log \left (x\right ) + b^{2} d n^{2} + 8 \, a b n x e + 2 \, b^{2} d n \log \left (c\right ) + 8 \, a b x e \log \left (c\right ) + 2 \, b^{2} d \log \left (c\right )^{2} + 4 \, a b d n \log \left (x\right ) + 2 \, a b d n + 4 \, a^{2} x e + 4 \, a b d \log \left (c\right ) + 2 \, a^{2} d}{4 \, x^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^3,x, algorithm="giac")

[Out]

-1/4*(4*b^2*n^2*x*e*log(x)^2 + 8*b^2*n^2*x*e*log(x) + 8*b^2*n*x*e*log(c)*log(x) + 2*b^2*d*n^2*log(x)^2 + 8*b^2
*n^2*x*e + 8*b^2*n*x*e*log(c) + 4*b^2*x*e*log(c)^2 + 2*b^2*d*n^2*log(x) + 8*a*b*n*x*e*log(x) + 4*b^2*d*n*log(c
)*log(x) + b^2*d*n^2 + 8*a*b*n*x*e + 2*b^2*d*n*log(c) + 8*a*b*x*e*log(c) + 2*b^2*d*log(c)^2 + 4*a*b*d*n*log(x)
 + 2*a*b*d*n + 4*a^2*x*e + 4*a*b*d*log(c) + 2*a^2*d)/x^2